<!DOCTYPE html>
<html>
<head>
  <title>政府采购公告监控</title>
  <link rel="stylesheet" href="renderer/assets/styles.css">
</head>
<body>
  <div class="sidebar">
    <ul>
      <li id="homeTab" class="active">主页</li>
      <li id="scheduleTab">定时任务</li>
    </ul>
  </div>
  <div class="main-content">
    <div id="homePage" class="page active">
      <div class="config-panel">
        <h2>参数配置</h2>
        <div id="params">
          <div class="param-row">
            <label>搜索类型:</label>
            <select id="searchtype">
              <option value="1">搜标题</option>
              <option value="2">搜全文</option>
            </select>
            <label>类型:</label>
            <select id="bidType">
              <option value="0">所有类型</option>
              <option value="1">公开招标</option>
              <option value="2">询价公告</option>
              <option value="3">竞争性谈判</option>
              <option value="4">单一来源</option>
              <option value="5">资格预审</option>
              <option value="6">邀请公告</option>
              <option value="7">中标公告</option>
              <option value="8">更正公告</option>
              <option value="9">其他公告</option>
              <option value="10">竞争性磋商</option>
              <option value="11">成交公告</option>
              <option value="12">终止公告</option>
            </select>
            <label>类别:</label>
            <select id="bidSort">
              <option value="0">所有类别</option>
              <option value="1">中央公告</option>
              <option value="2">地方公告</option>
            </select>
            <label>品目:</label>
            <select id="pinMu">
              <option value="0">所有品目</option>
              <option value="1">货物类</option>
              <option value="2">工程类</option>
              <option value="2">服务类</option>
            </select>
            <label>时间:</label>
            <select id="searchTime">
              <option value="0">今天</option>
              <option value="1">近3日</option>
              <option value="2">近1周</option>
              <option value="3">近1月</option>
              <option value="4">近3月</option>
              <option value="5">近半年</option>
              <option value="6">指定时间</option>
            </select>
          </div>
          <div class="param-row" id="datePickerRow" style="display: none;">
            <label>开始时间:</label>
            <input type="date" id="startDate">
            <label>结束时间:</label>
            <input type="date" id="endDate">
          </div>
          <div class="param-row">
            <label>关键词:</label>
            <input type="text" id="keywords" placeholder="用逗号分隔多个关键词">
          </div>
          <div class="param-row">
            <label>忽略词:</label>
            <input type="text" id="ignorekeywords" placeholder="用逗号分隔多个关键词">
          </div>
          <div class="param-row">
            <label>保存路径:</label>
            <input type="text" id="savePath" value="C:\\">
          </div>
        </div>
        <div>
          <label><input type="checkbox" id="saveToExcel"> 保存到Excel</label>
        </div>
        <button id="startBtn">立即执行</button>
        <button id="scheduleBtn">保存为定时任务</button>
        <div id="output"></div>
      </div>
      <div id="loading" class="loading">加载中...</div>
    </div>
    <div id="schedulePage" class="page">
      <div class="config-panel">
        <h2>已保存的定时任务</h2>
        <div id="savedConfigs"></div>
      </div>
    </div>
  </div>

  <!-- 定时任务配置弹窗 -->
  <div id="scheduleModal" class="modal" style="display: none;">
    <div class="modal-content">
      <span class="close">&times;</span>
      <h2>定时任务配置</h2>
      <div class="param-row">
        <label>任务名称:</label>
        <input type="text" id="scheduleName">
      </div>
      <div class="param-row">
        <label>启用:</label>
        <input type="checkbox" id="scheduleEnabled">
      </div>
      <div class="param-row">
        <label>间隔时间 (秒):</label>
        <input type="number" id="scheduleInterval" value="3600" min="300">
      </div>
      <button id="saveScheduleBtn">保存</button>
    </div>
  </div>

  <script src="renderer/renderer.js"></script>
</body>
</html>